/*
 * @Author: TalkMan
 * @Date: 2021-05-25 8:51:03
 * @LastEditTime: 2022-05-24 10:13:43
 * @LastEditors: 血雪球 wash0226@outlook.com
 * @Description: 承租户信息接口
 */
import omaxios from "@/utils/request";
export default {
  /**
   * @description: 获取承租户信息 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getTenantInfoList(params) {
    return omaxios.post("v3/lessee/lessee/queryPageByCondition", params);
  },
  addPictureInfo(formData) {
    // formData.organizationNo = sessionStorage.organizationNo;
    return omaxios.post("v3/lessee/lessee/add", formData);
  },
  // addPictureInfo(param) {
  //   // formData.organizationNo = sessionStorage.organizationNo;
  //   return omaxios.post("/idCard/add", param);
  // },
  /**
   * @description: 新增承租户信息
   * @param {Object} formData *
   * @return {Object}
   */
  addTenantInfo(formData) {
    // formData.organizationNo = sessionStorage.organizationNo;
    return omaxios.post("/lessee/contractPicture", formData);
  },
  /**
   * @description: 编辑承租户信息
   * @param {Object} formData *
   * @return {Object}
   */
  editTenantInfo(formData) {
    return omaxios.post("v3/lessee/lessee/edit", formData);
  },
  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  dellistTenantInfo(nolist) {
    return omaxios.post("v3/lessee/lessee/delListByNo", {
      noList: nolist
    });
  },
  /**
   * @description: 单个删除数据
   * @param {Array} list *
   * @return {Object}
   */
  delTenantInfo(Id) {
    return omaxios.get(`v3/lessee/lessee/delByNo?no=${Id}`);
  },
  /**
   * @description: 主键查询身份证数据
   * @param {String} idCardId *
   * @return {Object}
   */
  queryIdCardById(idCardId) {
    return omaxios.get(`/idCard/query/${idCardId}`);
  },
  /**
   * @description: 主键查询承租户数据
   * @param {String} lessesId *
   * @return {Object}
   */
  querylessesById(lessesId) {
    return omaxios.get(`v3/lessee/lessee/query/${lessesId}`);
  },
  /**
   * @description: 条件查询承租户数据
   * @param {String} organizationNo *
   * @return {Object}
   */
  queryLessesByCondition(e) {
    return omaxios.post("v3/lessee/lessee/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      contactStatus: e
      // organizationList: sessionStorage.organizationList
    })
  },
  /**
  * @description: 条件查询承租户数据
  * @param {String} organizationNo *
  * @return {Object}
  */
  querysesByCondition(e) {
    return omaxios.post("v3/lessee/lessee/queryByCondition", e)
  },
  // 添加缓存
  querybindCache(no) {
    return omaxios.get(`v3/lessee/lessee/bindCache?no=${no}`)
  },
  queryLesses() {
    return omaxios.get("/detection/queryLesses", {})
  },
  queryLessesFacilityByCondition() {
    return omaxios.post("/lessesFacilityMapper/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
      // contactStatus: e
      // organizationList: sessionStorage.organizationList
    })
  },
  /**
   * @description: 条件查询所有没有分配承租户的设施组
   * @param {String} organizationNo *
   * @return {Object}
   */
  queryfacility() {
    return omaxios.post("v3/facility/facility/queryAllFacilityGroupMapper", { organizationList: sessionStorage.organizationList.split("\,") })
  },
  queryOrganizationlist() {
    return omaxios.post("organization/queryByCondition", { isTenant: true })
  }
};
